<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const data = {
            zhangsan: 0,
            lisi: 1,
            wangwu: 2,
            zhufei: 88,
        }
        const expect = [
            {
                name: zhangsan,
                id: 0,
            },
            {
                name: lisi,
                id: 1,
            },
            {
                name: wangwu,
                id: 2,
            },
            {
                name: zhufei,
                id: 88,
            },
        ]
        const res = [];
        for (const key in data) {
            res.push({
                name: key, 
                id: data[key],
            });
        }
       console.log(res);
    </script>
</body>
</html>